package me.jessyan.mvparms.demo.mvp.ui.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import me.jessyan.mvparms.demo.mvp.ui.activity.MainActivity;

public class SelfStartingReceiver  extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Intent bootIntent = new Intent(context, MainActivity.class);
        // 这里必须为FLAG_ACTIVITY_NEW_TASK
        bootIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(bootIntent);
    }
}